import 'package:flutter/material.dart';
import 'package:t3_track/t3_track.dart';
import 'package:uikit/uikit.dart';

class EntryChangePopWidget extends StatelessWidget {
  final bool isHome;
  final VoidCallback delete;
  final VoidCallback change;

  const EntryChangePopWidget({
    Key? key,
    required this.isHome,
    required this.delete,
    required this.change
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    T3Track.trackPageIn('0199193000000');
    return Container(
      decoration: const BoxDecoration(
        color: LucyColors.lucy_F7F9FC,
          borderRadius: BorderRadius.all(Radius.circular(24)),
      ),
      height: 220.5 + MediaQuery.of(context).padding.bottom,
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          T3GestureDetector(
            onTap: () {
              Navigator.of(context).pop();
              change();
            },
            child: SizedBox(
              width: MediaQuery.of(context).size.width,
              height: 84,
              child: Center(
                child: Text(
                  isHome ? '修改家地址' : '修改公司地址',
                  style: const TextStyle(
                    color: LucyColors.lucy_00AD59,
                    fontSize: 20,
                    fontWeight: LucyFonts.semi_bold,
                  ),
                ),
              ),
            ),
          ),
          Container(
            height: 0.5,
            color: LucyColors.lucy_E9EBF0,
          ),
          T3GestureDetector(
            onTap: () {
              Navigator.of(context).pop();
              delete();
            },
            child: SizedBox(
              width: MediaQuery.of(context).size.width,
              height: 84,
              child: Center(
                child: Text(
                  isHome ? '删除家地址' : '删除公司地址',
                  style: const TextStyle(
                    color: LucyColors.lucy_00AD59,
                    fontSize: 20,
                    fontWeight: LucyFonts.semi_bold,
                  ),
                ),
              ),
            ),
          ),
          T3GestureDetector(
            onTap: () {
              T3Track.trackEventName('019919300000302');
              Navigator.of(context).pop();
              T3Track.trackPageOut('0199193000000');
            },
            child: Container(
              width: MediaQuery.of(context).size.width - 48,
              height: 52,
              decoration: const BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.all(Radius.circular(12)),
              ),
              child: const Center(
                child: Text(
                  '取消',
                  style:  TextStyle(
                    color: LucyColors.lucy_02102A,
                    fontSize: 16,
                    fontWeight: LucyFonts.regular,
                  ),
                ),
              ),
            ),
          ),
          SizedBox(height: MediaQuery.of(context).padding.bottom,),
        ],
      ),
    );
  }
}
